<my-pageheader></my-pageheader>

<mat-card style="margin: 20px 20px 50px 20px">
    <h2 align="center">身份证信息识别</h2>
    <br><br>

    <div class="row justify-content-center">
        <mat-card style="width: 90%">
            <div>
                <input type="file" ng2FileSelect [uploader]="fileSelector" accept=".jpg, .jpeg, .png, .gif, image/*" [disabled]="sending" />
            </div>
            <br>
            <div>
                <img style="max-width: 100%" src="{{selectedImgDataUrl}}" alt="">
            </div>
        </mat-card>
    </div>
    <div class="row justify-content-center">
        <mat-card style="width: 90%; margin-top: 20px">
            <div *ngIf="id_info && !sending">
                <div *ngIf="id_info['姓名']">姓名： {{id_info['姓名']}}</div>
                <div *ngIf="id_info['性别']">性别： {{id_info['性别']}}</div>
                <div *ngIf="id_info['民族']">民族： {{id_info['民族']}}</div>
                <div *ngIf="id_info['出生']">出生： {{id_info['出生']}}</div>
                <div *ngIf="id_info['住址']">住址： {{id_info['住址']}}</div>
                <div *ngIf="id_info['公民身份号码']">公民身份号码： {{id_info['公民身份号码']}}</div>
                <div *ngIf="id_info['error']">错误： {{id_info['error']}}</div>
            </div>
            <p *ngIf="!id_info && !sending">识别结果</p>
            <p *ngIf="sending">正在努力识别...</p>
            <mat-spinner *ngIf="sending"></mat-spinner>
            <p *ngIf="error">出错啦...</p>
        </mat-card>
    </div>
</mat-card>
